FROM {{ namespace }}/{{ image_prefix }}neutron-server:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"

USER root

{% block neutron_server_ovn %}{% endblock %}

{% import "macros.j2" as macros with context %}

{% if install_type == 'binary' %}
    {% set neutron_server_ovn_packages = [
        'python-networking-ovn',
    ] %}

{{ macros.install_packages(neutron_server_ovn_packages | customizable("packages")) }}

{% elif install_type == 'source' %}

ADD plugins-archive /

{% set neutron_server_ovn_plugins_pip_packages = [
    '/plugins/*'
] %}

RUN if [ "$(ls /plugins)" ]; then \
        {{ macros.install_pip(neutron_server_ovn_plugins_pip_packages) }}; \
    fi

{% endif %}

{% block neutron_server_ovn_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER neutron
